﻿<meta http-equiv="X-UA-Compatible" content="IE=10" />
<meta content="text/html; charset=UTF-8; X-Content-Type-Options=nosniff" http-equiv="Content-Type" />
<style type="text/css">
.win{padding-left:15px;padding-right:15px;padding-top:10px;padding-bottom:10px;}
.contacts_add_cancel_btn{color:white; border:none;white-space:nowrap; vertical-align: middle;background-color: #bfbfbf ;}
.contacts_add_advanced_lbl{}
#contacts_add_list_alphaSearch_div{
	overflow: hidden;
}
#contacts_add_list_alphaSearch_div ul{
	position: absolute;
	left: 610px;
	top: 45px;
	text-align: center;
	height:93%;
	font-size: 14px;
}
#contacts_add_list_alphaSearch_div li{
	cursor: pointer;
	list-style: none;
	/*border-bottom: 1px solid #39bf71;*/
	width: 15px;
}
.btn_bf{
	background-color: #bfbfbf!important;
}
.contacts_add_text_break{overflow: hidden;white-space: nowrap;text-overflow:ellipsis;}
.cursor_pointer{cursor:pointer;}
.disablebutton{background-color:#CCCCCC !important;cursor:inherit;}
</style>
<style type="text/css" id="for_ipad"></style>
<div id="contacts_add_win" class="wp_fz_12" style="padding-left:15px;padding-right:15px;padding-top:10px;padding-bottom:10px;">
	<div id="contacts_add_search_div" class="wp_mb_15">
		<label class="wp_mr_10">User name</label><input id="contacts_add_userid_txt" type="text" maxLength="255" class="wp_mr_10 wp_w_350" onkeypress="wp_contacts_add.enterSearchBtn(event,false)"/>
		<button type="button" class="k-button wp_w_40 wp_h_20 wp_fz_11 wp_mt_ne4" onclick="wp_contacts_add.onSearchClick()">Search</button>
		<label onclick="wp_contacts_add.onAdvancedSearchLabelClick()" class="wp_ml_20 cursor_pointer" style="color:#00aaff;">Advanced Search</label>
	</div>
	<table id="contacts_add_advancedsearch_tbl" class="wp_mb_15">
		<tr>
			<td class="wp_w_70">User name</td>
			<td><input id="contacts_add_un_txt" type="text" maxLength="255" class="wp_w_180" onkeypress="wp_contacts_add.enterSearchBtn(event,true)" /></td>
			<td  class="wp_w_50 wp_ml_20">User ID</td>
			<td class="wp_w_182"><input id="contacts_add_uid_txt" type="text" maxLength="255" class="wp_w_180" onkeypress="wp_contacts_add.enterSearchBtn(event,true)" /></td>
			<td class="wp_w_100"><button type="button" id="search_btn_contadd" class="k-button wp_w_40 wp_h_20 wp_fz_11 wp_mt_ne4 wp_ml_10" onclick="wp_contacts_add.onSearchClick(true)">Search</button><button type="button" id="back_btn_contadd" class="k-button wp_w_40 wp_h_20 wp_fz_11 wp_mt_ne4 wp_ml_10 btn_bf" onclick="wp_contacts_add.onBackClick()">Back</button></td>
		</tr>
		<tr>
			<td>Location</td>
			<td><input id="contacts_add_location_txt" type="text" maxLength="255" class="wp_w_180" onkeypress="wp_contacts_add.enterSearchBtn(event,true)"/></td>
			<td>Position</td>
			<td><input id="contacts_add_position_txt" type="text" maxLength="255" class="wp_w_180" onkeypress="wp_contacts_add.enterSearchBtn(event,true)"/></td>
			<td></td>
		</tr>
	</table>
	<div id="contacts_add_list_alphaSearch_div" data-alpa-name="contacts_add_list_alphaSearch_div" class="wp_w_623">
		<div id="contacts_add_list_div" class="wp_pt_3">
			<span id="contacts_add_searchresults"></span>
			<span id="contacts_add_noresult"></span></div></div>
	<div id="contacts_add_bottom_div" class="wp_pr_15 wp_mt_25"><button type="button" class="k-button wp_w_50 wp_h_20 wp_fz_10 wp_mt_ne4 right wp_mr_15" onclick="wp_contacts_add.onAddClick()">Follow</button></div>
</div>

	<script type="text/x-kendo-template" id="contacts_add_template" class="wp_fz_12" style="text-align:left;">	
		<div class="left wp_mb_20 wp_mr_15 wp_pl_2" name="template">
			<div class="left" style="position:relative;">
				<img src="imgs/choose.png" alt="" style="position:absolute;margin-left:-2px;margin-top:-3px; display:#=wp_contacts_add.isFollowContact(data.UserId)?'inline':'none'#; z-index:2;">
				<img class="wp_w_40 wp_h_45 cursor_pointer" style="position:relative;z-index:1;"  src="#: data.UserImageUrl #" onerror="wp_contacts_add.onContactsDefaultThumbnailWanted(this)" onclick="wp_contacts_add.onContactClick(this)"/>
				<span style="display: none;">#: data.UserId #</span>
			</div>
			<div class="left wp_w_135 wp_ml_10 wp_mt_3">
				<div class="wp_mt_ne6">
					<span class="wp_w_130 wp_h_20 left contacts_add_text_break cursor_pointer" title="#: data.UserName #" onclick="homepageProfileWin.user_info_win_create('#: data.UserId #')">#=wp_contacts_main.getUNHignlightHtml(data.UserName, wp_contacts_add.getletter())#</span>
					<div class="clear"></div>
			 	</div>
			 	<p class="contacts_add_text_break cursor_pointer" title="#: data.JobTitle #" onclick="homepageProfileWin.user_info_win_create('#: data.UserId #')">#: data.JobTitle #</p>
				<p class="contacts_add_text_break cursor_pointer" title="#: data.Office #" onclick="homepageProfileWin.user_info_win_create('#: data.UserId #')">#: data.Office #</p>
			</div>
		</div>
	</script>

<script type="text/javascript">
	var addContactsWin = $('#contacts_add_win');
	var useragent = Workport.getBrowser();
	var isMinPanel = true;
    addContactsWin.kendoWindow({width:'640px', 
								height: $(window).height()*0.9, 
								title:'Search Contact', 
								modal: true, 
								visible:false, 
								resizable: false, 
								draggable: false, 
								actions:["Close"],
								close:function(){wp_contacts_add.closeWindow();},
								open:function(){
									if(useragent == 'ipad'){
										$('#for_ipad').append('#contacts_add_list_alphaSearch_div_letter{left:600px!important}')
									}
								}
							}).data("kendoWindow").center();
	
	var wp_contacts_add = (function(){
		var pageSize = 36;
		var pageCount = 0;
		var hasScroll = false;
		var contactObj = {offset: pageCount*pageSize,
						  pageSize: pageSize,
						  location: '',
					      userId: '',
						  position: '',
					      userName: '',
						  action:0};
		var letterSearchTool;
		var strIds='';
		var loading;
		var contactsCallBackEven;

		return {
			createWindow:function(panelEvent){
				if(panelEvent){
					contactsCallBackEven = panelEvent;
				}
				if(useragent == 'ipad'){
					addContactsWin.data("kendoWindow").setOptions({height: $(window).height()*0.8});
				}else{
					addContactsWin.data("kendoWindow").setOptions({height: $(window).height()*0.9});
				}
				openWindow();
				//resize(false);
				if(!loading){loading = new Workport.Loader($('#contacts_add_list_div'));}
				wp_contacts_add.changePanel(false);
				// resetPageSize();				
				// refreshContactObj();
				// disableFollowButton();
				// searchContact(true);
				initSearchBar();
				// $('#contacts_add_noresult').hide();
				addContactsWin.data("kendoWindow").wrapper.find('.k-i-close').prop("id","close_btn");
			},
			
			onAdvancedSearchLabelClick:function(){
				wp_contacts_add.changePanel(true);
			},
			
			onBackClick:function(){
				wp_contacts_add.changePanel(false);
			},

			changePanel:function(isAdvSearch){
				wp_contacts_add.cancelControl();
				emptyInput();
				if(isAdvSearch){
					$('#contacts_add_search_div').hide();
					$('#contacts_add_un_txt').val($.trim($('#contacts_add_userid_txt').val()));
					$('#contacts_add_advancedsearch_tbl').show();
					resize(true);
				}else{
					$('#contacts_add_search_div').show();
					$('#contacts_add_userid_txt').val($.trim($('#contacts_add_un_txt').val()));
					$('#contacts_add_advancedsearch_tbl').hide();
					resize(false);
				}
				if(letterSearchTool){letterSearchTool.cancleHighLight();}
				resetPageSize();				
				refreshContactObj();
				disableFollowButton();
				clearContactsList();
				wp_i_want_to.showLoading(loading,$('#contacts_add_list_div'),false,true);
				searchContact(true);
				$('#contacts_add_noresult').hide();
			},
			
			onSearchClick:function(advanced){
				wp_contacts_add.cancelControl();
				if(checkValidInput(advanced)){
					pageCount = 0;
					var searchObj = {};
					searchObj.advanced = advanced;
					refreshContactObj();
					if(letterSearchTool){letterSearchTool.cancleHighLight();}
					if(advanced){
						var pass = true;
						hideValidationTooltip("#contacts_add_un_txt");
						hideValidationTooltip("#contacts_add_uid_txt");
						hideValidationTooltip("#contacts_add_location_txt");
						hideValidationTooltip("#contacts_add_position_txt");
						if($.trim($('#contacts_add_un_txt').val()) && $.trim($('#contacts_add_un_txt').val()).length < 3){
							showValidationTooltip("#contacts_add_un_txt", "Must enter atleast 3 characters.");
							pass = false;
						}else{
							hideValidationTooltip("#contacts_add_un_txt");
							contactObj.userName =  $.param({key: $.trim($('#contacts_add_un_txt').val())}).substring(4);
							searchObj.userName = $.param({key: $.trim($('#contacts_add_un_txt').val())}).substring(4);
						}
						if($.trim($('#contacts_add_uid_txt').val()) && $.trim($('#contacts_add_uid_txt').val()).length < 3){
							showValidationTooltip("#contacts_add_uid_txt", "Must enter atleast 3 characters.");
							pass = false;
						}else{
							hideValidationTooltip("#contacts_add_uid_txt");
							contactObj.userId = $.param({key: $.trim($('#contacts_add_uid_txt').val())}).substring(4);
							searchObj.userId = $.param({key: $.trim($('#contacts_add_uid_txt').val())}).substring(4);
						}
						if($.trim($('#contacts_add_location_txt').val()) && $.trim($('#contacts_add_location_txt').val()).length < 3){
							showValidationTooltip("#contacts_add_location_txt", "Must enter atleast 3 characters.");
							pass = false;
						}else{
							hideValidationTooltip("#contacts_add_location_txt");
							contactObj.location = $.param({key: $.trim($('#contacts_add_location_txt').val())}).substring(4);
							searchObj.location = $.param({key: $.trim($('#contacts_add_location_txt').val())}).substring(4);
						}
						if($.trim($('#contacts_add_position_txt').val()) && $.trim($('#contacts_add_position_txt').val()).length < 3){
							showValidationTooltip("#contacts_add_position_txt", "Must enter atleast 3 characters.");
							pass = false;
						}else{
							hideValidationTooltip("#contacts_add_position_txt");
							contactObj.position = $.param({key: $.trim($('#contacts_add_position_txt').val())}).substring(4);
							searchObj.position = $.param({key: $.trim($('#contacts_add_position_txt').val())}).substring(4);
						}
						if(!pass){return;}
					}else{
						hideValidationTooltip("#contacts_add_userid_txt");
						if(!$('#contacts_add_userid_txt').val() || 0 == $.trim($('#contacts_add_userid_txt').val()).length){
							showValidationTooltip("#contacts_add_userid_txt", "Please enter the keywords.");
							return;
						}else if($.trim($('#contacts_add_userid_txt').val()).length < 3){
							showValidationTooltip("#contacts_add_userid_txt", "Must enter atleast 3 characters.");
							return;
						}else{hideValidationTooltip("#contacts_add_userid_txt");}
						contactObj.userName =  $.param({key: $.trim($('#contacts_add_userid_txt').val())}).substring(4);
						searchObj.userName =  $.param({key: $.trim($('#contacts_add_userid_txt').val())}).substring(4);
					}
					clearContactsList();
					wp_i_want_to.showLoading(loading,$('#contacts_add_list_div'),false,true);
					searchContact(false,searchObj);
				}
			},
			
			onAddClick:function(){
				//WP2010 Invalid input parameters
				if(0<strIds.length){
					var loader = new Workport.Loader($('#contacts_add_list_div'),{boxCSS:{'opacity':1}});
					loader.show();
					Workport.ContactAPI.addContact(function(data){
						loader.hide();
						if('WP1008' != data.ResponseCode){
							Workport.utils.alertMsg("Error Message",data.ResponseMessage,function(_data){});
						}else{
							Workport.utils.alertMsg("Message",'You will now receive the updates related to the selected users in your Smart Stream.',function(_data){
								addContactsWin.data("kendoWindow").close();
								contactsCallBackEven();
							});
						}
					},{ids:strIds.slice(0,strIds.length-1),action:'follow'});
				}else{
					Workport.utils.alertMsg("Error Message","Must select at least one user.",function(_data){});
				}
			},
			onContactClick:function(element){
				element = $(element);
				if(element.prev().is(':hidden')){
					element.prev().show();
					strIds += element.next().text()+';';
				}else{
					element.prev().hide();
					strIds = strIds.replace(element.next().text()+';','');
				}
				if(0 < strIds.length){
					enableFollowButton();
				}else{
					disableFollowButton();
				}
			},
			cancelControl:function(){
				strIds = "";
				disableFollowButton();
			},
			isFollowContact:function(id){
				if(0 < strIds.length){
					var ids = strIds.split(';');
					for(var i =0;i<ids.length;i++){
						if(id == ids[i]){return true;}
					}
				}
				return false;
			},
			onContactsDefaultThumbnailWanted: function(element) {
				if (element == undefined) {
					return;
				}
				$(element).attr('src', 'imgs/UserDefault.png');
			},
		
			getletter: function(){
				return contactObj.userName;
			},
			
			enterSearchBtn: function(event,advanced){
				var keycode
				// IE 
				if(window.event){
					keycode = event.keyCode
				}else if(event.which) // Netscape/Firefox/Opera
				{
					keycode = event.which
				}
				if(keycode==13) //Enter key
				{
					wp_contacts_add.onSearchClick(advanced);
				}
			},
			// closeClicked true== X was clicked, false == must be call close function
			closeWindow:function(closeClicked){
				pageCount = 0;
				pageSize = 36;
				strIds = '';
				emptyInput();
				refreshContactObj();
				clearContactsList();
				if(letterSearchTool){letterSearchTool.cancleHighLight();}
				$('#contacts_add_list_alphaSearch_div .letter_filter').off('*');
				$('#contacts_add_list_alphaSearch_div .letter_filter').empty();
				$('#contacts_add_list_alphaSearch_div .letter_filter').remove();
				$('#contacts_add_list_alphaSearch_div .imgwrapper').remove();
				$('#contacts_add_list_alphaSearch_div .slimScrollDiv').off('*');
				//$('#contacts_add_list_alphaSearch_div').off('*');
				//$('#contacts_add_list_alphaSearch_div').empty();
				//if(!closeClicked){addContactsWin.data("kendoWindow").close();}				
			}
		}
		
		function openWindow(){
			addContactsWin.data("kendoWindow").open().center();
		}

		function emptyInput(){
			$('#contacts_add_un_txt').val('');
			$('#contacts_add_uid_txt').val('');
			$('#contacts_add_location_txt').val('');
			$('#contacts_add_position_txt').val('');
			$('#contacts_add_userid_txt').val('');
		}

		function clearContactsList(){
			$('#contacts_add_list_div').off("*");
			$('#contacts_add_list_div').empty();
		}

		function bindEvents(count){
			//pageSize-3 < count
			if(pageCount == 0){
				if(pageSize-3 < count){
					if($('#contacts_add_list_alphaSearch_div .slimScrollDiv').length <= 0){
						if(useragent == 'ipad'){
							$('#contacts_add_list_div').css('width','623px');
							$('#contacts_add_list_div').css('overflow-y','scroll');
							$("#contacts_add_list_div").bind("scroll",function(){
		                         if($("#contacts_add_list_div")[0].scrollHeight <= $("#contacts_add_list_div")[0].scrollTop + $("#contacts_add_list_div").height()){ // bottom
			                            wp_i_want_to.showLoading(loading,$('#contacts_add_list_div'),true,true);
										pageCount++;
										contactObj.offset = pageCount*pageSize;
										searchContact(false);
		                        }
		                    }); 
							} else{
								$('#contacts_add_list_div').slimScroll({height: $('#contacts_add_list_div').height(), width: '623px', wheelStep : 20, scrollTo: '0px',disableFadeOut:true}).bind('slimscroll', function(e, pos) {
								if('bottom' == pos){
										wp_i_want_to.showLoading(loading,$('#contacts_add_list_div'),true,true);
										pageCount++;
										contactObj.offset = pageCount*pageSize;
										searchContact(false);
									}
								});	
						}
					}
				}else{
					if(useragent != 'ipad'){
						$('#contacts_add_list_div').slimScroll({ scrollTo: '-500px',disableFadeOut:true });
					}
				}
			}
			resize($('#contacts_add_search_div').is(':hidden')?true:false);
		}
		
		function resetPageSize(){
			pageSize = Math.ceil(($('#contacts_add_list_div').height()-30)/65)*3;
		}
		//true: init search, false: other search
		function searchContact(isInit,searchObj){
			$('#contacts_add_noresult').remove();
			$('#contacts_add_searchresults').hide();
			Workport.ContactAPI.searchContact(function(contacts){
				if(pageCount == 0){
					clearContactsList();
					if('WP1003'==contacts.ResponseCode && contactObj.action == 1){
						$('#contacts_add_list_div').append('<div id="contacts_add_noresult" style="margin:0 auto;text-align:center;"></div>');
						if(contactObj.userName){
							$('#contacts_add_noresult').text("No contacts found starting with "+decodeURIComponent(contactObj.userName));
						}else{
							$('#contacts_add_noresult').text("No results found.");
						}						
						$('#contacts_add_noresult').show();
						$('#contacts_add_list_div').css('text-align','center');
					}else if('WP1008'==contacts.ResponseCode){
						if(searchObj){
							$('#contacts_add_list_div').append('<div id="contacts_add_searchresults" style="margin-bottom:20px;"></div>');
							var searchInfo = '';
							if(searchObj.advanced){
								searchInfo = "Showing "+contacts.Contacts.length+" result(s) for "+decodeURIComponent(searchObj.userName?(searchObj.userName+','):'')
																										  +decodeURIComponent(searchObj.userId?(searchObj.userId+','):'')
																										  +decodeURIComponent(searchObj.location?(searchObj.location+','):'')
																										  +decodeURIComponent(searchObj.position?(searchObj.position):'');
							}else{//decodeURIComponent
								searchInfo = "Showing "+contacts.Contacts.length+" result(s) for "+decodeURIComponent(searchObj.userName);
							}
							$('#contacts_add_searchresults').text(resultString(searchObj, searchInfo));
						}
						$('#contacts_add_list_div').css('text-align','left');
						bindContacts(contacts.Contacts);
						bindEvents(contacts.Contacts.length);
					}else{
						if('No results found' == contacts.ResponseMessage.toString()){
							$('#contacts_add_list_div').append('<div id="contacts_add_searchresults" style="margin-bottom:20px;"></div>');
							$('#contacts_add_list_div').append('<div id="contacts_add_noresult" style="margin:0 auto;text-align:center;"></div>');
							if(isInit){
								$('#contacts_add_noresult').text("No Contacts found.");
							}else{
								if(searchObj){									
									var searchInfo = '';
									if(searchObj.advanced){
										searchInfo = "Showing 0 result(s) for "+decodeURIComponent(searchObj.userName?(searchObj.userName+','):'')
																										  +decodeURIComponent(searchObj.userId?(searchObj.userId+','):'')
																										  +decodeURIComponent(searchObj.location?(searchObj.location+','):'')
																										  +decodeURIComponent(searchObj.position?(searchObj.position):'');
									}else{
										searchInfo = "Showing 0 result(s) for " + decodeURIComponent(searchObj.userName);
									}
									$('#contacts_add_searchresults').text(resultString(searchObj, searchInfo));
								}
								$('#contacts_add_noresult').text("No results found.");
							}
							$('#contacts_add_noresult').show();
							$('#contacts_add_list_div').css('text-align','left');
						}else{
							Workport.utils.alertMsg("Error Message",contacts.ResponseMessage,function(_data){});
						}
						
					}
				}else{
					if('WP1008'==contacts.ResponseCode){
						if(!contacts.Contacts || 0 == contacts.Contacts.length){}
						bindContacts(contacts.Contacts);
						//bindEvents(contacts.Contacts.length);
					}else{
						pageCount--;
					}
				}
				if(loading){loading.hide();}				
			},contactObj);
		}

		function resultString(searchObj, searchInfo){
			var res = "",temp = "";
			temp =  searchInfo[searchInfo.length - 1];
			if(temp == ","){
				if(searchObj.advanced){
					res = searchInfo.substring(0, searchInfo.length - 1);
				}else{
					res = searchInfo;
				}
			}else{
				res = searchInfo;
			}
			return res;
		}
			
		function initSearchBar(){
			//if(letterSearchTool){letterSearchTool.cancleHighLight();letterSearchTool.update();}
			//$('#contacts_add_list_alphaSearch_div .letter_filter').off('*');
			//$('#contacts_add_list_alphaSearch_div .letter_filter').empty();
			//$('#contacts_add_list_alphaSearch_div .letter_filter').remove();
			//$('#contacts_add_list_alphaSearch_div .imgwrapper').remove();

			letterSearchTool = Letter('#contacts_add_list_alphaSearch_div',function(_letter){
				clearContactsList();
				emptyInput();
				wp_contacts_add.cancelControl();
				wp_i_want_to.showLoading(loading,$('#contacts_add_list_div'),false,true);
				pageCount = 0;
				refreshContactObj();
				contactObj.action=1;
				if(_letter=="#"){
					contactObj.userName = "others";
				}else if(_letter!="All"){
					contactObj.userName = _letter;
				}				
				searchContact(false);
			});
		}
		
		function refreshContactObj(){
			contactObj.offset = pageCount*pageSize;
			contactObj.pageSize = pageSize;
			contactObj.location = null;
			contactObj.userId = null;
			contactObj.position = null;
			contactObj.userName = null;
			contactObj.action=0;
		}
		
		function bindContacts(contacts) {
			if(contacts && 0 < contacts.length){
				var tmpl = kendo.template($.trim($('#contacts_add_template').html()));
				var arr = new Array();
				$.map(contacts, function(_elem) {
					arr.push(tmpl(_elem));
				});
				$(arr.join('')).appendTo($('#contacts_add_list_div'));
			}else{
				$('#contacts_add_list_div').append('<div id="contacts_add_noresult" style="margin:0 auto;text-align:center;"></div>');
				$('#contacts_add_noresult').text("No Contacts found.");		
				$('#contacts_add_noresult').show();
				$('#contacts_add_list_div').css('text-align','center');
			}
		}
		
		function checkValidInput(advanced){
			return true;
		}
		
		function showValidationTooltip(elementName,alertContent){
			$(elementName).kendoTooltip({
				content: alertContent,
				position: "right",
				hide: function() {
					$(elementName).data('kendoTooltip').destroy();
				},
				show:function(){
					//$(elementName).data('kendoTooltip').arrow.css('top','16px');                        
				}
			});
			$(elementName).data('kendoTooltip').show();              
			//$(elementName).data('kendoTooltip').content.css({'padding':'7px 10px 6px 10px','margin-top':'5px'});
		}
		
		function hideValidationTooltip(elementName){
			if($(elementName).data('kendoTooltip')){$(elementName).data('kendoTooltip').hide();}			
			//$(elementName).data('kendoTooltip').content.css({'padding':'7px 10px 6px 10px','margin-top':'5px'});
		}
		
		// true == advanced search, false == search
		function resize(advanced){
			if(advanced){
				$('#contacts_add_list_div').height(addContactsWin.height()-$('#contacts_add_advancedsearch_tbl').height()-$('#contacts_add_bottom_div').height()-60);
			}else{
				$('#contacts_add_list_div').height(addContactsWin.height()-$('#contacts_add_search_div').height()-$('#contacts_add_bottom_div').height()-61);
			}
			$('#contacts_add_win .slimScrollDiv').css({height: $('#contacts_add_list_div').height()});
			//initSearchBar();
			if(advanced){
				$('#contacts_add_list_alphaSearch_div ul').css({top:70});
			}else{
				$('#contacts_add_list_alphaSearch_div ul').css({top:45});
			}
		}
		
		function disableFollowButton(){
			$('#contacts_add_bottom_div :button').prop('disabled',true);
			$('#contacts_add_bottom_div :button').addClass('disablebutton');
		}
		
		function enableFollowButton(){
			$('#contacts_add_bottom_div :button').prop('disabled',false);
			$('#contacts_add_bottom_div :button').removeClass('disablebutton');
		}
		function destory(){
		}
	})();
</script>